package com.wxd.framework.common.web.session;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface SessionProvider {

	/**
	 * 获取属性值
	 * @param request
	 * @param name
	 * @return
	 */
	public Serializable getAttribute(HttpServletRequest request, String name);

	/**
	 * 设置属性值
	 * @param request
	 * @param response
	 * @param name
	 * @param value
	 */
	public void setAttribute(HttpServletRequest request, HttpServletResponse response, String name, Serializable value);
	
	/**
	 * 获取SessionId
	 * @param request
	 * @param response
	 * @return
	 */
	public String getSessionId(HttpServletRequest request, HttpServletResponse response);

	/**
	 * 注销当前登录
	 * @param request
	 * @param response
	 */
	public void logout(HttpServletRequest request, HttpServletResponse response);
	
	/**
	 * 设置属性值（object）
	 * @param request
	 * @param response
	 * @param name
	 * @param value
	 */
	public void setAttributeObject(HttpServletRequest request,
			HttpServletResponse response, String name, Object value);
	
	/**
	 * 获取属性值（object）
	 * @param request
	 * @param name
	 * @return
	 */
	public Object getAttributeObject(HttpServletRequest request, String name);
	
	/**
	 * 移除某个属性
	 * @param request
	 * @param response
	 * @param name
	 */
	public void removeAttribute(HttpServletRequest request,HttpServletResponse response, String name); 
}
